package main

import (
	"fmt"
	"time"
)

func getTimeInfo() {
	now := time.Now()
	ago := now.AddDate(-8, 0, 0)
	detialTime := time.Date(ago.Year(), ago.Month(), ago.Day(), 9, 30, 0, 0, time.Local)
	msStamp := detialTime.UnixNano() / int64(time.Millisecond)
	formatTime := detialTime.Format("2006/01/02 15:04:05 -0700")
	weekday := detialTime.Weekday()
	_, weekOfYear := detialTime.ISOWeek()
	alldays := int(now.Sub(detialTime).Hours() / 24)

	fmt.Printf("1. 毫秒时间戳：%d\n", msStamp)
	fmt.Printf("2. 格式化时间：%s\n", formatTime)
	fmt.Printf("3. 那天是：%s，本年已过周数：%d\n", weekday, weekOfYear)
	fmt.Printf("4. 距离今天已过天数：%d 天\n", alldays)
}

func main() {
	getTimeInfo()
}
